<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('打印请假记录')" />
    <style>
        .z1{font-size:13px;height: 35px;}
        td,th {border-width: 1px;border-style: solid;border-collapse: collapse; word-break: break-all; width: 250px; border-color: #333333;}
    </style>
</head>
<body class="white-bg">
    <div class="btn-group-sm hidden-xs" style="margin-left: 20px" id="toolbar" role="group">
        <a class="btn btn-success" onclick="PreviewMytable()">
            <i class="fa fa-print"></i> 打印
        </a>
    </div>
    <div id="print_content">
        <table style="width: 100%;">
            <tr class="z1">
                <td>姓名</td>
                <td>[[${recordLeave.userName}]]</td>
                <td>身份证号</td>
                <td>[[${recordLeave.createBy}]]</td>
            </tr>
            <tr class="z1">
                <td>科室</td>
                <td>[[${recordLeave.deptName}]]</td>
                <td>职务</td>
                <td>[[${recordLeave.dutyName}]]</td>
            </tr>
            <tr class="z1">
                <td>休假类型</td>
                <td>[[${@dict.getLabel('record_leave_type', recordLeave.leaveType)}]]</td>
                <td>请假事由</td>
                <td>[[${recordLeave.leaveContent}]]</td>
            </tr>
            <tr class="z1">
                <td>休假日期</td>
                <td colspan="2">[[${#dates.format(recordLeave.startTime, 'yyyy-MM-dd')}]]至[[${#dates.format(recordLeave.endTime, 'yyyy-MM-dd')}]]</td>
                <td>共[[${recordLeave.days}]]天</td>
            </tr>
            <tr class="z1">
                <td>科室意见</td>
                <td>[[${recordLeave.chiefOpinion}]]</td>
                <td colspan="2">科主任（护士长）签字：[[${recordLeave.chiefName}]]</td>
            </tr>
            <tr class="z1">
                <td>主管科室意见</td>
                <td>[[${recordLeave.manageOpinion}]]</td>
                <td colspan="2">主管科室负责人签字：[[${recordLeave.manageName}]]</td>
            </tr>
            <tr class="z1">
                <td>人事科意见</td>
                <td>[[${recordLeave.humanOpinion}]]</td>
                <td colspan="2">人事科负责人签字：[[${recordLeave.humanName}]]</td>
            </tr>
            <tr class="z1">
                <td>主管科室分管领导意见</td>
                <td>[[${recordLeave.leaderOpinion}]]</td>
                <td colspan="2">主管科室分管领导签字：[[${recordLeave.leaderName}]]</td>
            </tr>
            <tr style="height: 40px;">
                <td colspan="4" style="border: 0px; text-align: center; font-size: 12px; width: 100%;">注：休假及出差进修培训等不在岗情况均需填写，本表一式两份，由人事科及所在科室分别留存</td>
            </tr>
        </table>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: lodop-js" />
    <script th:inline="javascript">
        var LODOP; //声明为全局变量

        var leaveId = [[${recordLeave.leaveId}]];

        function PreviewMytable() {
            $.ajax({
                type: "post",
                url: ctx + "record/leave/update",
                dataType: "json",
                data: {"leaveId" : leaveId}
            });

            LODOP = getLodop();

            LODOP.SET_PRINT_PAGESIZE(0,0,0,"A4");
            var strStyle="<style> .z1{font-size:13px;height: 35px;}td,th {border-width: 1px;border-style: solid;border-collapse: collapse; word-break: break-all; width: 250px; border-color: #333333;} </style>";
            LODOP.ADD_PRINT_TEXT("10mm","70mm","70mm","12mm","职工请假审批表");
            LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
            LODOP.SET_PRINT_STYLEA(0,"Bold",1);
            LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
            LODOP.SET_PRINT_STYLEA(0,"Horient",3);
            LODOP.ADD_PRINT_TABLE("20mm","10mm","90%","35%",strStyle+document.getElementById("print_content").innerHTML);

            LODOP.ADD_PRINT_TEXT("150mm","70mm","70mm","12mm","职工请假审批表");
            LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
            LODOP.SET_PRINT_STYLEA(0,"Bold",1);
            LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
            LODOP.SET_PRINT_STYLEA(0,"Horient",3);
            LODOP.ADD_PRINT_TABLE("160mm","10mm","90%","35%",strStyle+document.getElementById("print_content").innerHTML);

            LODOP.PREVIEW();
        }
    </script>
</body>
</html>